#导包
import time
import unittest
from scripts.test01_login import TestLogin
from tools.HTMLTestRunner import HTMLTestRunner
#组装测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLogin))

#指定测试报告路径
report = "./report/report-{}.html".format(time.strftime("%Y_%m_%d %H_%M_%S"))
#打开文件流
with open(report,"wb") as f:
    #创建htmltestrunner运行器
    runenr = HTMLTestRunner(f,title="IHRM API Report")

    #执行测试套件
    runenr.run(suite)
